<!DOCTYPE html>
<html>
<head>
    <title>角色</title>
    <script src="/statics/libs/jquery.min.js"></script>
    <script src="/statics/libs/vue.min.js"></script>
    <link rel="stylesheet" href="/statics/plugins/element-ui/lib/theme-chalk/index.css">
    <script src="/statics/plugins/element-ui/lib/index.js"></script>

</head>
<style>
    /*解决Vue刷新一瞬间出现样式未加载完或者出现Vue代码问题*/
    [v-cloak]{
        display: none;
    }
</style>
<body>
<div id="cwapp" v-cloak>
    <div v-show="showList">

        <el-button-group>
            <el-col :span="8">
                <el-input v-model.trim="q.roleName" @keyup.enter="query" placeholder="角色名称"></el-input>
            </el-col>
            <el-button   @click="query">查询</el-button>
            <el-button type="primary" @click="add">新增</el-button>
            <el-button type="primary" @click="update">修改</el-button>
            <el-button type="danger" @click="del">删除</el-button>
        </el-button-group>

        <el-table
                ref="multipleTable"
                :data="page.list"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="handleSelectionChange">
            <el-table-column
                    type="selection">
            </el-table-column>
            <el-table-column
                    prop="roleId"
                    label="角色id">
            </el-table-column>
            <el-table-column
                    prop="roleName"
                    label="角色名称">
            </el-table-column>
            <el-table-column
                    prop="remark"
                    label="备注"
                    show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="createTime"
                    label="创建时间">
            </el-table-column>
        </el-table>
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="page.currPage"
                :page-sizes="[5, 10, 15, 20]"
                :page-size="page.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="page.totalCount"
                style="text-align: center">
        </el-pagination>
    </div>

    <div v-show="!showList" >

        <el-card class="box-card" v-show="!showList" style="width: 35%">
            <div slot="header" class="clearfix">
                <span>{{title}}</span>
            </div>
            <el-form :model="role" ref="ruleForm" label-width="100px" class="demo-ruleForm">
                <el-form-item label="角色名称" prop="roleName">
                    <el-input v-model="role.roleName"></el-input>
                </el-form-item>
                <el-form-item label="备注" prop="remark">
                    <el-input v-model="role.remark"></el-input>
                </el-form-item>
                <el-form-item>
                    <strong>功能权限</strong>
                    <el-tree
                            :data="selectMenuList"
                            show-checkbox
                            node-key="menuId"
                            check-strictly="true"
                            default-expand-all
                            :default-checked-keys="menuIdList"
                            :props="defaultProps"
                    ref="tree">
                    </el-tree>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="saveOrUpdate">确定</el-button>
                    <el-button @click="loadPage(false)">返回</el-button>
                </el-form-item>
            </el-form>
        </el-card>

    </div>
</div>
<!-- 选择机构 -->
<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>
<script src="/statics/js/modules/sys/role.js?_${.now?long}"></script>
</body>
</html>
